﻿using System;

namespace dPet.Domain.Models
{
	using Hangerd;
	using Hangerd.Entity;

	public class Hospital : EntityBase
	{
		#region Public Properties

		private string _name;

		/// <summary>
		/// 医院名称
		/// </summary>
		[RecordModify]
		public string Name 
		{
			get { return _name; }
			set
			{
				if (string.IsNullOrWhiteSpace(value))
				{
					throw new HangerdException("医院名称不可为空");
				}

				_name = value.Trim();
			}
		}

		/// <summary>
		/// 地址
		/// </summary>
		[RecordModify]
		public string Address { get; set; }

		/// <summary>
		/// 电话号码
		/// </summary>
		[RecordModify]
		public string PhoneNumber { get; set; }

		/// <summary>
		/// 传真号码
		/// </summary>
		[RecordModify]
		public string FaxNumber { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		public DateTime CreateTime { get; private set; }

		#endregion

		#region Constructors

		private Hospital() { }

		public Hospital(string name)
		{
			this.Name = name;
			this.CreateTime = DateTime.Now;
		}

		#endregion

		#region Public Methods

		#endregion
	}
}
